<?php
/**
 *
 *
 */
namespace Yz\modules\Generic;

use Yz_Array;
class Controller_Delete
    extends Controller_AbstractUpdate
{

    /**
     *  forbid access beyond admin panel
     *
     */
    const ACCESS = \Yz_Access_Interface::AC_ADMIN;

    /** The list of required arguments for controller
     *  @var array
     */
    protected $arguments = array(
        'itemId',
    );

    protected $model;
    protected $itemId;


    /****************************
     *      Public methods      *
     ****************************/

    /** forbid use of GET method
     *  @throw Yz_Controller_Exception_Forbidden
     */
    public function doGet(Yz_Array $args)
    {
        throw new \Yz_Controller_Exception_Forbidden("Access via GET method denied");
    }



    /** parse arguments: obtain itemId
     *  @param string(int) arg (from URI)
     *  @return this
     *  @throw Yz_Controller_Exception_InvalidArgument
     */
    protected function setItemId($arg)
    {
        $this->itemId = \Yz_Int::testPositive($arg);
        return $this;
    }



}
